package com.example.photography.retrofit;



import com.example.photography.bean.Product_bean;
import com.example.photography.bean.User_Info;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

//请求接口
public interface ApiService {
    /**
     * 用户
     */
    @POST("/user_edit")
    @FormUrlEncoded
    Observable<ResponseData<User_Info>> user_edit(@FieldMap Map<String,String> map);

    @POST("/home_recommed")
    @FormUrlEncoded
    Call<ResponseData<Map>> test(@FieldMap Map<String, String> map);

    @POST("/edit_group")
    Call<ResponseData<Map>> uploadFile(@Body MultipartBody multipartBody);

    @POST("/add_product")
    Observable<ResponseData<Product_bean>> add_product(@Body MultipartBody multipartBody);

    //查询单个作品作品
    @POST("/product_pro_id")
    @FormUrlEncoded
    Observable<ResponseData<Product_bean>> product_pro_id(@Field("pro_id") String product_id);

    //发布作品评论
    @POST("/add_pro_comment")
    @FormUrlEncoded
    Observable<ResponseData<Product_bean.CommentsBean>> add_pro_comment(@Field("pro_id") String product_id,
                                                                        @Field("observer_id") String observer_id,
                                                                        @Field("content") String content);

    //发布作品评论
    @POST("/add_pro_reply")
    @FormUrlEncoded
    Observable<ResponseData<Product_bean.CommentsBean.ReplysBean>> add_pro_reply
    (@Field("pc_id") String pc_id, @Field("reply_id") String reply_id,
     @Field("target_id") String target_id, @Field("content") String content);

}
